<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <meta name="format-detection" content="address=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="browsermode" content="application" />
    <meta name="x5-page-mode" content="app" />
    <title>设置</title>
    <meta charset="utf-8" />
    <link href="../css/main.css?rev=@@hash" rel="stylesheet" />

    <style type="text/css">
    	body{
    		background: #1EB97E;
    	}
        .showCardBox {
            position: relative;
        }
        .showCard{
		    margin: .2rem auto 0;
		    width: 3.43rem;
		    height: .9rem;
		    background: #fff;
		    border-radius: .1rem;
	        box-shadow: 0 0.03rem 0.13rem #097F52;
        }
        .showCard span {
            position: absolute;
            bottom: .15rem;
            right: .2rem;
            font-size: .12rem;
        }
        .resetBankCardBtn {
		    width: 100%;
		    height: .6rem;
		    line-height: .6rem;
		    position: fixed;
		    left: 0;
		    bottom: 0;
		    z-index: 100;
		    text-align: center;
		    background: #fff;
        }
        .resetBankCardBtn img {
            width: .27rem;
            height: .27rem;
            margin-bottom: -.07rem;
        }
        .resetBankCardBtn .changCard{
        	font-size: .15rem;
    		color: #1F1F1F;
        }
        .bankico,.noAndName,.setIco{
        	float: left;
        	display: inline-block;
        }
        .bankico{
		    width: .43rem;
		    height: .43rem;
		    margin: .25rem .11rem 0 .16rem;
        }
        .noAndName{
		    width: 65%;
		    padding: .28rem 0 0 0;
		    color: #949494;
        }
        .noAndName h5{
            font-size: .17rem;
            color: #1F1F1F;	
        }
        .setIco{
		    width: .28rem;
		    height: .28rem;
		    float: right;
		    margin: .3rem .16rem 0 0;
        }
    </style>
</head>
<body>
	<div class="layer_load alert11">
        <div class="layer_mask"></div>
        <a href="rebindCard.html">
	        <div class="resetBankCardBtn">
	        	<img src="../img/bankcard.png" >
	        	<span class="changCard">更换银行卡信息</span>
	        </div>
        </a>
    </div>
    <div class="showCardBox">
        <!--<div class="showCard">
            <img src="../img/bankIco/bank22.png" class="bankico">
            <div class="noAndName">
            	<h5>*************32456</h5>
            	<div>建设银行</div>
            </div>
            <img src="../img/setIco.png" class="setIco">
        </div>
                <div class="showCard">
            <img src="../img/bankIco/bank22.png" class="bankico">
            <div class="noAndName">
            	<h5>*************32456</h5>
            	<div>建设银行</div>
            </div>
            <img src="../img/setIco.png" class="setIco">
        </div>
                <div class="showCard">
            <img src="../img/bankIco/bank22.png" class="bankico">
            <div class="noAndName">
            	<h5>*************32456</h5>
            	<div>建设银行</div>
            </div>
            <img src="../img/setIco.png" class="setIco">
        </div>-->
    </div>

</body>
    <!-- 脚本 -->
    <script src="../lib/zepto.min.js?rev=@@hash"></script>
    <script src="../js/main.js?rev=@@hash"></script>
    <script type="text/javascript">
        !function(global,userUtil,layer,dataUtil){
            var sessionId=userUtil.sid();
            if(sessionId){
                //初始化银行卡信息
                function onlineRepay(){
                    var _data={
                        "sessionId": sessionId
                    }
                    $.ajax({
                        url: global.localUrl + "wallet/userBankList",
                        type: "post",
                        data: JSON.stringify(_data),
                        contentType: 'application/json;charset=utf-8',
                        success: function (re) {
                            if (1 == re.code) {
                                if(!re.data[0]){
                                    layer.tips("未获取到绑定的银行卡信息");
                                    setTimeout(function(){
                                        window.location.href= "../index.html";
                                    },2000);
                                }else {
                                	$.each(re.data, function(i) {
                                		var bankNo = re.data[i].bankNumberNo;
                                			bankNo = re.data[i].bankNumberNo.substring(re.data[i].bankNumberNo.length,re.data[i].bankNumberNo.length-3);
//	                                    $html ='<li> <img class="cardIco" />'
//											+'<div class="cardInfo">'
//											+'<div class="cardNumer"><sub class="hidNo">**** **** **** </s>'+bankNo+'</div>'
//											+'<div>中国'+re.data[i].bankName+'</div></div>'
//											+'<img class="cardSetIco" src="../img/setIcon.png" /></li>'
											
										$html = '<div class="showCard">'
											+'<img class="bankico">'
											+'<div class="noAndName">'
											+'<h5><sub class="hidNo">**** **** **** </sub>'+bankNo+'</h5>'
											+'<div>中国'+re.data[i].bankName+'</div>'
											+'</div>'
											+'<img src="../img/setIco.png" class="setIco">'
											+'</div>'
	                                    $('.showCardBox').append($html);
											switch(re.data[i].bankId){
												case '22': $('.bankico').attr('src','../img/bankIco/bank22.png');break;
                                                case '23': $('.bankico').attr('src','../img/bankIco/bank23.png');break;
                                                case '24': $('.bankico').attr('src','../img/bankIco/bank24.png');break;
                                                case '25': $('.bankico').attr('src','../img/bankIco/bank25.png');break;
                                                case '26': $('.bankico').attr('src','../img/bankIco/bank26.png');break;
                                                case '27': $('.bankico').attr('src','../img/bankIco/bank27.png');break;
                                                case '28': $('.bankico').attr('src','../img/bankIco/bank28.png');break;
                                                case '30': $('.bankico').attr('src','../img/bankIco/bank30.png');break;
                                                case '31': $('.bankico').attr('src','../img/bankIco/bank31.png');break;
                                                case '32': $('.bankico').attr('src','../img/bankIco/bank32.png');break;
                                                case '33': $('.bankico').attr('src','../img/bankIco/bank33.png');break;
                                                case '34': $('.bankico').attr('src','../img/bankIco/bank34.png');break;
                                                case '35': $('.bankico').attr('src','../img/bankIco/bank35.png');break;
											}	                                    
                                	});
					                $('.setIco').on('click',function(){
					                    $('.alert11').css('display','block');
					                })
					                $('.layer_mask').on('click',function(){
					                    $('.alert11').css('display','none');
					                })                                	
                                }
                            }
                            else{

                                layer.tips(re.message);
                            }
                        },
                        error: function () {
                            layer.tips(global.netError);
                        }
                    });
                }
                onlineRepay();
            }else {
                window.location.href="login.html";
            }
        }(global,userUtil,layer,dataUtil)
    </script>
</html>
